﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Zocono.WCS.Admin.Models.ConfigManager
{
    public class BytesMapObjectInfoPageData
    {
        public long ID { get; set; }
        public string Js_Id { get { return ID.ToString(); } }
        /// <summary>
        /// plc 连接配置
        /// </summary>
        public long PlcReadDbId { get; set; }
        public string Js_PlcReadDbId { get { return PlcReadDbId.ToString(); } }
        /// <summary>
        /// 单个对角的字节索引
        /// </summary>
        public int BytesIndex { get; set; }
        /// <summary>
        /// 单个对象的字节长度
        /// </summary>
        public int BytesLength { get; set; }
        /// <summary>
        /// 单个对象的长度
        /// </summary>
        public int ObjectLength { get; set; }
        /// <summary>
        /// 单个对象的大小
        /// </summary>
        [Required(AllowEmptyStrings = true)]
        public int ObjectCount { get; set; }
        /// <summary>
        /// 对象名称
        /// </summary>
        public string ObjectName { get; set; }

        /// <summary>
        /// db编号
        /// </summary>
        [Required(AllowEmptyStrings = true)]
        public int DbCode { get; set; }
        /// <summary>
        /// 报文处理模块类型，用于工厂创建报文处理模块对象
        /// </summary>
        [Required(AllowEmptyStrings = true)]
        public string ProcessModuleType { get; set; }
        /// <summary>
        /// 报文处理模块对象的名称
        /// </summary>
        [Required(AllowEmptyStrings = true)]
        public string ProcessModuleName { get; set; }

        public List<PlcReadPageData> PlcReadDatas { get; set; }
        ///// <summary>
        ///// PLC名称其实由 jobname和plcconnectID确定一个
        ///// </summary>
        //[Required(AllowEmptyStrings = true)]
        //public string PlcName { get; set; }
    }

    public class PlcReadPageData
    {
        public string ID { get; set; }
        public string PlcName { get; set; }
        public string ProcessModuleName { get; set; }
    }
}
